SHELL = /bin/sh

TRUE = /bin/true

#Edoc variables
DOCDIR = doc

.PHONY: all conf conf_clean test docs unittest

all: conf compile

compile: c_ewgi

conf:
	cd conf&& $(MAKE)

test: conf compile t_ewgi

c_ewgi:
	cd lib/ewgi/src&& $(MAKE)

t_ewgi:
	cd lib/ewgi/test/src&& $(MAKE)

clean:
	rm lib/ewgi/src/*.beam; rm lib/ewgi/ebin/*.beam; rm lib/ewgi/test/src/*.beam; rm lib/ewgi/test/ebin/*.beam; \
	$(TRUE)

conf_clean:
	cd conf&& $(MAKE) clean; $(TRUE)

dist_clean: conf_clean clean

launch_test:
	sudo yaws -i -pa lib/ewgi/ebin -pa lib/ewgi/test/ebin -name ewgi

examples: compile
	cd lib/ewgi/priv/examples/src && $(MAKE)

launch_examples: examples
	erl -pa lib/ewgi/priv/examples/ebin lib/ewgi/ebin